require(['./config'], () => {
    require(['swiper', 'template', 'header'], (Swiper, template) => {
        class Shopping {
            constructor() {
                this.go()
                this.box()
            }
            go() {
                this.topArrow = document.querySelector('.topArrow');
                this.bottomArrow = document.querySelector(".bottomArrow");
                this.shoppingnum = document.querySelector("#shopping-num");
                this.topArrow.onclick = () => {
                    this.shoppingnum.value++
                        if (this.shoppingnum.value > 100) {
                            // alert("限购")
                            this.shoppingnum.value = 100;
                        }
                }
                this.bottomArrow.onclick = () => {
                    this.shoppingnum.value--
                        if (this.shoppingnum.value < 0) {
                            // alert("底线")
                            this.shoppingnum.value = 0;
                        }
                }


            }
            box() {
                // console.log($('.shopping-nav-middle-bot p>span'));
                // console.log($('.shopping-box>div'))
                $('.shopping-nav-middle-bot p>span').on('click', function() {
                    $(this).addClass('ac').siblings().removeClass('ac')

                    $('.shopping-box>div').eq($(this).index()).css('display', 'block').siblings().css('display', 'none')
                })
            }
        }
        new Shopping()
    })

})